//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#pragma once

#pragma pack(push) 
#pragma pack(1)

class PktAvatarPlayReq : public VxPktHdr
{
public:
	PktAvatarPlayReq()
	{
		m_u16PktLen = sizeof( PktAvatarPlayReq );
		m_u16PktType = PKT_TYPE_AVATAR_PLAY_REQ;
		u16Idx = 0;			// index of created character
		u64Sn = 0;			// serial number of avatar
		u32Error = 0;		// error code if any
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	}
	U16		u16Idx;			// index of created character
	U32		u64Sn;			// serial number of avatar
	U32		u32Error;		// error code if any

};


//============================================================================
class PktAvatarPlayReply : public VxPktHdr, public AvatarModelInfo
{
public:
	PktAvatarPlayReply()
	{
		m_u16PktLen = sizeof( PktAvatarPlayReply );
		m_u16PktType = PKT_TYPE_AVATAR_PLAY_REPLY;
		u16Flags = 0;		// flags of character state
		u64Sn = 0;			// serial number of avatar
		u32Error = 0;		// error code if any
		memset( au8Res, 0, sizeof( au8Res ) );
		vx_assert( 0 == ( m_u16PktLen & 0x0f ) );
	}
	_inline AvatarModelInfo * GetAvatarModelInfo( void ){ return (AvatarModelInfo *)this; }

	U16		u16Flags;		// flags of character state
	U32		u64Sn;			// serial number of avatar
	U32		u32Error;		// error code if any
	char	au8Res[7];		// reserved for alignment
};

#pragma pack(pop)